/*
** read_buff_from_socket.c for  in /home/faye_m//tmp/zappy-2011/new_server/src/zappy-2011/new_server/src
** 
** Made by mouhamed faye
** Login   <faye_m@epitech.net>
** 
** Started on  Sun Jul 10 11:46:38 2011 mouhamed faye
** Last update Sun Jul 10 11:47:49 2011 mouhamed faye
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
#include "types.h"
#include "parser.h"

void    read_buff_from_socket(T_env *e, int socket, t_server_params *p)
{
  if ((e->nbytes = recv(e->i, e->buf, 1024, 0)) <= 0)
    {
      printf("Joueur %d a quitte zappy \n", e->i);
      disconnect_socket(e);
    }
  else
    {
      manage_cmd(e, socket, e->buf, p);
    }
}
